package com.jy.shenghuilogistics.controller;

import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.jy.shenghuilogistics.bean.Province;
import com.jy.shenghuilogistics.bean.Sitetb;
import com.jy.shenghuilogistics.service.SiteService;

import javax.annotation.Resource;
import java.util.List;

@RestController()
@CrossOrigin
public class SiteController {
    @Resource
    SiteService siteService;

    //站点模糊查询
    @RequestMapping("getSite")
    public List<Sitetb> getSite(Sitetb s) {
        return siteService.getSite(s);
    }

    //根据名字获取站点对象
    @RequestMapping("getSiteByName")
    public Sitetb getSiteByName(String siteName) {
        return siteService.getSiteByName(siteName);
    }

    //获得已开通的所有省市区
    @RequestMapping("getAllPro")
    public List<Province> getAllPro() {
        return siteService.getAllPro();
    }
}
